﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ArticleListViewModel>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<div class="col_l_1a">
   <%if (Model.Articles != null && Model.Articles.Count > 0)
     {
         var first = Model.Articles[0]; %> 
    <div class="col_l_1_img">
        <a href="/article/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>">
            <% string imgPath = (first.ImagePath != null && first.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(first.ID, 223, 165, first.ImagePath, Model.ImagePath, Model.RootImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
            <img src="<%=imgPath %>" title="<%=first.Title %>" alt="<%=first.Title %>" class="bor_img" width="223" height="165" style="overflow:hidden"/>
        </a>
    </div>
    <div class="col_l_1_txt">
        <h2>
            <a href="/article/details/<%=first.ID %>/<%=Html.ToUrlFriendly(first.Title)%>" class="link_org"><%=Html.Encode(first.Title) %></a></h2>
        <div>
            <%=Html.Encode(first.Summary) %>
        </div>
    </div>
    <div class="clear"></div>
    <%if (Model.Articles.Count > 1)
    {
        var count = Model.Articles.Count <= 4 ? Model.Articles.Count : 4;
        for (int i = 1; i < count; i++)
        {
            var nofirst =i==1?string.Empty: "new_top_3_mar";
            string imgPath1 = (Model.Articles[i].ImagePath != null && Model.Articles[i].ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(Model.Articles[i].ID, 127, 96, Model.Articles[i].ImagePath, Model.ImagePath, Model.RootImageUrl) : SDT.Lib.Common.Globals.DefaultLogo;
            %>
            
            <div class="new_top_3 f_l mar_t <%=nofirst %>">
                <p>
                    <a href="/article/details/<%=Model.Articles[i].ID %>/<%=Html.ToUrlFriendly(Model.Articles[i].Title)%>">
                        <img class="bor_img" src="<%=imgPath1 %>" title="<%=Model.Articles[i].Title %>" alt="<%=Model.Articles[i].Title %>" width="127" height="96" /></a>
                </p>
                <p>
                    <a href="/article/details/<%=Model.Articles[i].ID %>/<%=Html.ToUrlFriendly(Model.Articles[i].Title)%>"><%=Html.Encode(Model.Articles[i].Title)%></a>
                </p>
            </div>
        <%}
    } %>
<%} %>
<div class="clear">&nbsp;</div>
</div>


